package cmm;



public class MachineEntry implements IMachineEntry {

	/**
	 * 
	 */
	private static final long serialVersionUID = -670423463239068496L;

	private int TaskAmount;
	
	private ConnectionInformation ConnInfo;
	
	private MachineState State;
	
	private String ClusterMachineName;
	
//---------------------------------------------------------------------
	
	public MachineEntry(int taskAmount, ConnectionInformation connInfo, MachineState state) {
		super();
		TaskAmount = taskAmount;
		ConnInfo = connInfo;
		State = state;
	}
	
	public MachineEntry() {
		super();
	}

	public MachineEntry clone() throws CloneNotSupportedException {
		MachineEntry NewEntry = (MachineEntry) super.clone();
		NewEntry.ConnInfo = this.ConnInfo.clone();
		NewEntry.ClusterMachineName = new String(this.ClusterMachineName);
		return NewEntry;
	}
	
	public void decTaskCount() {
		TaskAmount--;
	}

	public ConnectionInformation getConnInfo() {
		return ConnInfo;
	}

	public MachineState getMachineState() {
		return State;
	}

	public void putTaskCount(int TaskAmount){
		this.TaskAmount = TaskAmount;
	}
	
	public int getTaskCount() {
		return TaskAmount;
	}

	public void incTaskCount() {
		TaskAmount++;
	}

	public void putConnInfo(ConnectionInformation Conn) {
		ConnInfo = Conn;
	}

	public void putMachineState(MachineState State) {
		this.State = State;
	}


	public String getClusterMachineName() {
		return ClusterMachineName;
	}


	public void putClusterMachineName(String ClusterMachineName) {
		this.ClusterMachineName = ClusterMachineName;
	}

}
